﻿using ECO.Admin.Core.Entities.System;
using ECO.Admin.Core.EntityCore;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ECO.Admin.Core.Entities.User
{
    [SugarTable("UserLoginLog", TableDescription = "用户登录日志表")]
    public class UserLoginLog : Entity<int>
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        public int UserId { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(UserId))]
        public SysUser User { get; set; }

        /// <summary>
        /// 登录时间
        /// </summary>
        public DateTime LoginTime { get; set; }

        /// <summary>
        /// 登录设备
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string LoginDevice { get; set; }


        /// <summary>
        /// IP地址
        /// </summary>
        [SugarColumn(IsNullable = true,ColumnName = "IP_Address")]
        public string IPAddress { get; set; }

        /// <summary>
        /// 登录状态
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool LoginStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Comments { get; set; }
    }
}
